#pragma once

#include once "winapifamily.bi"
#include once "usb.bi"
#include once "usbioctl.bi"

#define __USBDI_H__
'' TODO: #define USBD_STATUS_CANCELLING ((USBD_STATUS) 0x00020000)
'' TODO: #define USBD_STATUS_CANCELING ((USBD_STATUS) 0x00020000)
'' TODO: #define USBD_STATUS_NO_MEMORY ((USBD_STATUS) 0x80000100)
'' TODO: #define USBD_STATUS_ERROR ((USBD_STATUS) 0x80000000)
'' TODO: #define USBD_STATUS_REQUEST_FAILED ((USBD_STATUS) 0x80000500)
'' TODO: #define USBD_STATUS_HALTED ((USBD_STATUS) 0xc0000000)

#define USBD_HALTED(Status) ((ULONG(Status) shr 30) = 3)
#define USBD_STATUS(Status) (ULONG(Status) and __MSABI_LONG(&h0fffffff))
const URB_FUNCTION_RESERVED0 = &h0016
const URB_FUNCTION_RESERVED = &h001d
const URB_FUNCTION_LAST = &h0029
const USBD_PF_DOUBLE_BUFFER = &h00000002
#define USBD_PF_VALID_MASK (((USBD_PF_CHANGE_MAX_PACKET or USBD_PF_DOUBLE_BUFFER) or USBD_PF_ENABLE_RT_THREAD_ACCESS) or USBD_PF_MAP_ADD_TRANSFERS)
const USBD_TRANSFER_DIRECTION_BIT = 0
const USBD_SHORT_TRANSFER_OK_BIT = 1
const USBD_START_ISO_TRANSFER_ASAP_BIT = 2
#define USBD_TRANSFER_DIRECTION(x) ((x) and USBD_TRANSFER_DIRECTION_IN)
